﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
using DevExpress.Xpo.Metadata;

namespace DataModel.Models
{
    /// <summary>
    /// Класс физ. лица
    /// </summary>
    public class Person : BasePersistObject
    {
        public Person(Session session)
            : base(session)
        {

        }
        protected Person()
        {

        }
        protected Person(Session session, XPClassInfo classInfo)
            : base(session, classInfo)
        {

        }
        private string _FirstName;
        [DevExpress.Xpo.DisplayName("Имя")]
        public virtual string FirstName
        {
            get
            {
                return _FirstName;
            }
            set
            {
                SetPropertyValue("FirstName", ref _FirstName, value);
            }
        }
        private string _LastName;
        [DevExpress.Xpo.DisplayName("Фамилия")]
        public virtual string LastName
        {
            get
            {
                return _LastName;
            }
            set
            {
                SetPropertyValue("LastName", ref _LastName, value);
            }
        }
        private string _PatronymicName;
        [DevExpress.Xpo.DisplayName("Отчество")]
        public virtual string PatronymicName
        {
            get
            {
                return _PatronymicName;
            }
            set
            {
                SetPropertyValue("PatronymicName", ref _PatronymicName, value);
            }
        }
        private DateTime _BirthDate;
        [DevExpress.Xpo.DisplayName("Дата рождения")]
        public virtual DateTime BirthDate
        {
            get
            {
                return _BirthDate;
            }
            set
            {
                SetPropertyValue("BirthDate", ref _BirthDate, value);
            }
        }
        private DriverCard _DriverCard;
        [Persistent("DirverCard")]
        public virtual DriverCard DriverCard
        {
            get
            {
                return _DriverCard;
            }
            set
            {
                SetPropertyValue("DriverCard", ref _DriverCard, value);
            }
        }
    }
    public struct DriverCard
    {
        public string Serial { get; set; }
        public string Number { get; set; }
        public DateTime DateOut { get; set; }
    }
}
